/* Util.cpp  --  special operations 

Copyright (C) 2010 Gabriel Alises Cano, Javier Angulo Lucerón

This file is part of Computer Graphics : Final Project 09-10.

Computer Graphics : Final Project 09-10 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Computer Graphics : Final Project 09-10 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Computer Graphics : Final Project 09-10.  If not, see <http://www.gnu.org/licenses/>. */

#include "Util.h"

void
normalize (GLdouble* vec3)
{
  float module = sqrt (pow (vec3[0], 2) + pow (vec3[1], 2) + pow (vec3[2], 2));
  vec3[0] /= module;
  vec3[1] /= module;
  vec3[2] /= module;
}

